package com.hut.oa.model.dao.workattend;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.hut.oa.model.bean.AttendComplaint;
import com.hut.oa.model.bean.User;

public interface AttendComplaintDao extends PagingAndSortingRepository<AttendComplaint, Long> {
	Page<AttendComplaint> findAll(Pageable pageable);
	
	@Query("from AttendComplaint ac where ac.workattend.user.realName like %?1%  and ac.state=?2 ")
	Page<AttendComplaint> finbynameandst(String name,Integer st,Pageable pageable);
	
	@Query("from AttendComplaint ac where ac.workattend.user.realName like %?1% ")
	Page<AttendComplaint> finbyname(String name,Pageable pageable);
}
